<?php
	$id=$_GET['id'];
	
	$gambar = $koneksi->query("select gambar from produk where id_produk = $id");
	$g = $gambar->fetch(PDO::FETCH_ASSOC);
	
	$sttmt = $koneksi->exec("delete from produk where id_produk = $id");
	
	$url_sukses='utama.php?module=mod_produk';

	if($sttmt){
		unlink("../produk/$g[gambar]");
		echo "<meta http-equiv='refresh' content='0; url=$url_sukses'>";
		exit;
	}else{
		echo mysql_error();
	}
?>